﻿#pragma once

#include "MirImageControl.h"
#include "MirLabel.h"
#include "MirButton.h"
#include <string>

using namespace Client::MirGraphics;
using namespace Client::MirScenes;

namespace Client::MirControls
{
    enum class MirMessageBoxButtons
    {
        OK,
        OKCancel,
        YesNo,
        YesNoCancel,
        Cancel
    };

    class MirMessageBox final : public MirImageControl
    {
    public:
        MirLabel *Label;
        MirButton *OKButton, *CancelButton, *NoButton, *YesButton;
        MirMessageBoxButtons Buttons = static_cast<MirMessageBoxButtons>(0);
        bool AllowKeyPress = true;

        virtual ~MirMessageBox()
        {
            delete Label;
            delete OKButton;
            delete CancelButton;
            delete NoButton;
            delete YesButton;
        }

        MirMessageBox(const std::string &message, MirMessageBoxButtons b = MirMessageBoxButtons::OK, bool allowKeys = true);

        void Show() override;


        void OnKeyDown(KeyEventArgs *e) override;
        void OnKeyUp(KeyEventArgs *e) override;
        void OnKeyPress(KeyPressEventArgs *e) override;


        static void Show(const std::string &message, bool close = false);

        #pragma region Disposable

    protected:
        void Dispose(bool disposing) override;

        #pragma endregion
    };
}
